{include file="public_head" /}

<!-- upload -->
<link href="__STATIC__/css/uploads.css" rel="stylesheet">
<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">

<body class="nav-md">

<div class="container body">

    <div class="main_container">

        {include file="public_sidebar,public_nav" /}
        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">

                <div class="page-title">
                    <div class="title_left">
                        <h3>广告投放管理</h3>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>{$mate_title}
                                    <!--<small>different form elements</small>-->
                                </h2>
                                <ul class="nav navbar-right panel_toolbox">
                                    <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                    </li>
                                    <li><a class="close-link"><i class="fa fa-close"></i></a>
                                    </li>
                                </ul>
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <br/>
                                <form class="form-horizontal form-label-left" enctype="multipart/form-data" action=""
                                      method="post" id="registerForm">

                                    <!--<div class="form-group">-->
                                        <!--<label class="control-label col-md-3 col-sm-3 col-xs-12">广告栏目：</label>-->
                                        <!--<div class="col-md-3 col-sm-6 col-xs-12">-->
                                            <!--<select name="parenTid" class="select2_single" style="width:100%" datatype="*" nullmsg="请选择广告栏目！" errormsg="请选择广告栏目！">-->
                                                <!--<option value="" selected>请选择分类</option>-->
                                                <!--{volist name="data" id="list"}-->
                                                <!--<option value="{$list.id}" {eq name='list.id' value='$item.parenTid|default=""' } selected {/eq} {eq name="list.topId" value="0"}disabled=""{/eq}>-->
                                                <!--{neq name="list.parenTid" value="0"}-->
                                                <!--{:str_repeat('　',$list['count'])}-->
                                                <!--{/neq}-->
                                                <!--{eq name="item.parenTid|default=''" value="0"}-->
                                                <!--<span>&nbsp;</span>-->
                                                <!--{else /}-->
                                                <!--<span>&nbsp;</span>-->
                                                <!--{/eq}-->
                                                <!--{neq name="list.count" value="1"}|&nbsp;&#45;&#45;&nbsp;{/neq}-->
                                                <!--{$list.title}-->
                                                <!--</option>-->
                                                <!--{/volist}-->
                                            <!--</select>-->
                                        <!--</div>-->
                                    <!--</div>-->

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">广告投放标题：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" placeholder="请输入广告投放标题"
                                                   class="form-control col-md-7 col-xs-12" name="title"
                                                   value="{$item.title|default=''}"
                                                   datatype="*"
                                                   nullmsg="请输入广告投放标题！" errormsg="请输入广告投放标题！"
                                            >
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">跳转分类：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <label class="radio_box">
                                                <input type="radio" name="skip_type" id="skip_type_1" class="cartradio"
                                                       value="url"
                                                       datatype="*"
                                                       nullmsg="请选择跳转分类！" errormsg="请选择跳转分类！"
                                                       {eq name='item.skip_type|default=""' value='url' }
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="skip_type_1"></label>
                                                <span>URL跳转</span>
                                                &nbsp;&nbsp;
                                            </label>
                                            <label class="radio_box">
                                                <input type="radio" name="skip_type" id="skip_type_2" class="cartradio"
                                                       value="web"
                                                       datatype="*"
                                                       nullmsg="请选择跳转分类！" errormsg="请选择跳转分类！"
                                                       {eq name='item.skip_type|default=""' value='web' }
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="skip_type_2"></label>
                                                <span>详情页跳转（ID）</span>
                                                &nbsp;&nbsp;
                                            </label>
                                            <label class="radio_box">
                                                <input type="radio" name="skip_type" id="skip_type_3" class="cartradio"
                                                       value="goods"
                                                       datatype="*"
                                                       nullmsg="请选择跳转分类！" errormsg="请选择跳转分类！"
                                                       {eq name='item.skip_type|default=""' value='goods' }
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="skip_type_3"></label>
                                                <span>商品跳转（ID）</span>
                                                &nbsp;&nbsp;
                                            </label>
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">Url链接 / 店铺跳转 /
                                            商品跳转：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" placeholder="请输入Url链接或APP内部跳转"
                                                   class="form-control col-md-7 col-xs-12" name="linkUrl" datatype="*"
                                                   nullmsg="Url链接不能为空！" errormsg="Url链接不能为空！"
                                                   value="{$item.linkUrl|default=''}"
                                            >
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>


                                    <div class="divider-dashed"></div>

                                    <div class="form-group" id="adarea" {neq name='$item.type|default=""' value='image'
                                         }style="display:none" {
                                    /neq}>
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">图片上传：</label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <div id="imgdiv">
                                            <img id="imgShow" src="__PUBLIC__/{$item.picUrl|default=''}" width="200"
                                                 height="190" onerror="this.src='/static/console//images/default.png'"/>
                                        </div>
                                        <div class="uploader white">
                                            <input type="text" class="filename" name="picUrl"
                                                   value="{$item.picUrl|default=''}" readonly/>
                                            <input type="button" name="file" class="button" value="上传..."/>
                                            <input type="file" id="up_img" name="picUrl"
                                                   value='{$item.picUrl|default=""}'/>
                                        </div>
                                    </div>
                            </div>

                            <div class="form-group" id="adtext" {eq name='$item.type|default=""' value='image'
                                 }style="display:none" {
                            /eq} >
                            <label class="control-label col-md-3 col-sm-3 col-xs-12">文字或HTML（代码）：</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">

                                            <textarea type="text" placeholder="请填写文字或HTML（代码）" id="containers" style="height:300px;" name="content">
                                                    {$item.content|default=''}
                                           </textarea>
                            </div>
                        </div>

                        <div class="divider-dashed"></div>

                        <!--<div class="form-group">-->
                            <!--<label class="control-label col-md-3 col-sm-3 col-xs-12">排　　序：</label>-->
                            <!--<div class="col-md-1 col-sm-6 col-xs-12">-->
                                <!--<input type="text" placeholder="请填写排序"-->
                                       <!--class="form-control col-md-7 col-xs-12" name="sort"-->
                                       <!--value="{$item.sort|default='0'}"-->
                                <!--&gt;-->
                            <!--</div>-->
                        <!--</div>-->

                        <!--<div class="divider-dashed"></div>-->

                        <!--<div class="form-group">-->
                            <!--<label class="control-label col-md-3 col-sm-3 col-xs-12">使用区间时间：</label>-->
                            <!--<div class="col-md-6 col-sm-6 col-xs-12">-->
                                <!--<input type="text" placeholder="请选择时间区间"-->
                                       <!--class="form-control col-md-7 col-xs-12" name="interval_timer"-->
                                       <!--id="interval_timer"-->
                                       <!--{present name="$item.id" }-->
                                       <!--value="{$item.start_time} / {$item.end_time}"-->
                                       <!--{/present}-->
                                <!--datatype="*"-->
                                <!--nullmsg="请选择时间区间！" errormsg="请选择时间区间！"-->
                                <!--&gt;-->
                            <!--</div>-->
                        <!--</div>-->

                        <!--<div class="divider-dashed"></div>-->

                        <div class="form-group">
                            <label class="control-label col-md-3 col-sm-3 col-xs-12">启用状态：</label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <label class="radio_box">
                                    <input type="radio" name="status" id="status_1" class="cartradio"
                                           value="1"
                                           datatype="*"
                                           nullmsg="请选择启用状态！" errormsg="请选择启用状态！"
                                           {eq name='item.status|default=""' value='1' }
                                           checked
                                           {/eq}
                                    >&nbsp;&nbsp;
                                    <label for="status_1"></label>
                                    <span>启用</span>
                                    &nbsp;&nbsp;
                                </label>
                                <label class="radio_box">
                                    <input type="radio" name="status" id="status_2" class="cartradio"
                                           value="2"
                                           datatype="*"
                                           nullmsg="请选择启用状态！" errormsg="请选择启用状态！"
                                           {eq name='item.status|default=""' value='2' }
                                           checked
                                           {/eq}
                                    >&nbsp;&nbsp;
                                    <label for="status_2"></label>
                                    <span>禁用</span>
                                    &nbsp;&nbsp;
                                </label>
                            </div>
                        </div>

                        <div class="ln_solid"></div>

                        <div class="form-group">
                            <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                                {present name="$item.id"}
                                <input type="hidden" name="id" value="{$item.id}">
                                {/present}
                                <button type="submit" class="btn btn-primary">提交</button>
                                <a type="reset" class="btn btn-success" onclick="history.go(-1)">返回</a>
                            </div>
                        </div>

                        </form>
                    </div>
                </div>
            </div>
        </div>


    </div>
    <!-- /page content -->

</div>

</div>
</div>
<!-- ueditor -->
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.config.js"></script>

<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.all.min.js"></script>

<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/lang/zh-cn/zh-cn.js"></script>
{include file="public_foot" /}
<!-- validform -->
<script src="__STATIC__/js/Validform_v5.3.2_min.js"></script>
<script src="__STATIC__/js/layer.js"></script>
<!-- daterangepicker -->
<script src="__STATIC__/js/datepicker/daterangepicker.js"></script>
<!-- upload -->
<script type="text/javascript" src="__STATIC__/js/uploadPreview.js"></script>
<!--select-->
<script src="__STATIC__/js/select/select2.full.min.js"></script>
<script>
    // 实例化编辑器

    var ue = UE.getEditor('containers');

    // validform
    $(function () {

        $.Tipmsg.r = null;

        var showmsg = function (msg) {
            //假定你的店铺商品提示方法为showmsg， 在方法里可以接收参数msg，当然也可以接收到o及cssctl;
            alert(msg);
        }
        $("#registerForm").Validform({
            tiptype: function (msg) {
                layer.msg(msg);
            },
            tipSweep: true
        });

        // upload
        new uploadPreview({UpBtn: "up_img", DivShow: "imgdiv", ImgShow: "imgShow"});

        // interval_timer
        $('#interval_timer').daterangepicker(null,
                function (start, end, label) {
                    console.log(start.toISOString(), end.toISOString(), label);
                });

        // select2
        $(".select2_single").select2({
            placeholder: "请选择分类",
            allowClear: true
        });

    })
    //调用方法
    function GetMode(m) {
        if (m == "html" || m == "text") {
            $("#adarea").hide();
            $("#adtext").show();
        }
        else {
            $("#adarea").show();
            $("#adtext").hide();
        }
    }

</script>
</body>

</html>
